package org.jeecg.modules.tplus.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;

/**
 * TPlus response Object基类
 *
 *
 * @author hzq
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public abstract class TPlusBaseRepDto {
    /**
     *  返回状态
     */
    @Schema(description = "返回状态")
    @JsonProperty(value = "result")
    private boolean result;

    /**
     * 返回信息
     */
    @Schema(description = "返回信息")
    @JsonProperty(value = "sid")
    private String sid;

    /**
     * 记录总条数
     */
    @Schema(description = "记录总条数")
    @JsonProperty(value = "TotalCount")
    private int totalCount;

    /**
     * 记录总页数
     */
    @Schema(description = "记录总页数")
    @JsonProperty(value = "TotalPage")
    private int totalPage;

    /**
     * 当前页数
     */
    @Schema(description = "当前页数")
    @JsonProperty(value = "CurrentPage")
    private int currentPage;

    /**
     * 错误信息
     */
    @Schema(description = "错误信息")
    @JsonProperty(value = "ErrMessage")
    private String errMessage;

    /**
     * 是否成功
     */
    @Schema(description = "是否成功")
    @JsonProperty(value = "Success")
    private String success;

    /**
     * 错误信息编码
     */
    @Schema(description = "错误信息编码")
    @JsonProperty(value = "ErrCode")
    private String errCode;

    /**
     *  返回编码
     */
    @Schema(description = "返回编码")
    @JsonProperty(value = "code")
    private String code;

    /**
     *  返回信息
     */
    @Schema(description = "返回信息")
    @JsonProperty(value = "message")
    private String message;

    /**
     *  返回信息
     */
    @Schema(description = "返回信息")
    @JsonProperty(value = "error")
    private ErrorEntity errorEntity;

    @Data
    public static class ErrorEntity{
        /**
         *  返回编码
         */
        @Schema(description = "返回编码")
        @JsonProperty(value = "code")
        private String code;

        /**
         *  返回信息
         */
        @Schema(description = "返回信息")
        @JsonProperty(value = "msg")
        private String msg;
    }

}
